package com.aglhz.nature.utils;

import android.content.Context;
import android.content.SharedPreferences;
import android.text.TextUtils;

public class ReadSharedPrences {

	public static void read(Context context) {
		String token;
		String wx_token;
		String nor_token;
		SharedPreferences sharedPreferences;
		// 获取sharedPreferences里面的信息,微信
		sharedPreferences = context.getSharedPreferences("WX_INFO",
				Context.MODE_PRIVATE);
		wx_token = sharedPreferences.getString("token", "");
		// 获取sharedPreferences里面的信息,普通登陆
		sharedPreferences = context.getSharedPreferences("Normal_Info",
				Context.MODE_PRIVATE);
		nor_token = sharedPreferences.getString("NORMAL_Token", "");
		if (!("" == wx_token)) {
			token = wx_token;
		} else {
			token = nor_token;
		}
		
		if(!TextUtils.isEmpty(token)){
			CheckTokenHelper.loginCheck(context, token);
		}
	}
}
